#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int n, m;
int main()
{
    ll sum1 = 0,sum2 = 0;
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    cin >> n >> m;
    for(int i = 1;i <= n; i++)
    {
        for(int j = 1; j <= m;j++)
        {
            sum1 += min(i,j);
            sum2 += i * j;
        }
    }
    cout << sum1 << " " << sum2 - sum1 << endl;
    return 0;
}